@extends('app')

@section('content')
<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/bbs/category')}}">板块列表</a></li>
    <li><a href="{{ url('/admin/bbs/category/create') }}">添加板块</a></li>
</ul>


<div class="panel panel-default description2 mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>分类名称</th>
                    <th>排序</th>
                    <th>推荐</th>
                </tr>
            </thead>
            <tbody>
                @foreach($category as $key=>$cg)
                <tr  id="news_{{$cg->area_id}}">
                    <td>
                        <font color="#428bca">@if(count($cg->childrenAreas) > 0)
                        <i class="icon-chevron-down" id="father_{{$cg->area_id}}"></i>
                        @endif
                        {{ $cg->title }}</font>
                    </td>
                    <td>{{ $cg->sort}}</td>
                    <td>
                        
                    </td>
                </tr>
                    @foreach($cg->childrenAreas as $subc)
                    <tr id="news_{{$subc->area_id}}">
                        <td>
                            ｜－－ {{ $subc->title }} 
                            @if(count($subc->childrenAreas) > 0)
                            <font color="#428bca"><i class="icon-chevron-down" style="margin-left:20px;" id="father_{{$cg->area_id}}"></i></font>
                            @endif
                        </td>
                        <td>{{ $subc->sort}}</td>
                        <td id="disabled">
                            @if($subc->is_hot == 1)
                            <span class="glyphicon glyphicon-ok-circle  green-remove"
                                    onclick="changeUserStatus('/admin/content/area/hot','{{ $subc->area_id }}', '{{ $subc->is_hot }}', '{{ csrf_token() }}')"></span>
                            @else
                            <span class="glyphicon glyphicon-remove-circle red-ok"
                                    onclick="changeUserStatus('/admin/content/area/hot','{{ $subc->area_id }}', '{{ $subc->is_hot }}', '{{ csrf_token() }}')"></span>
                            @endif
                        </td>
                    </tr>
                    @endforeach
                @endforeach
            </tbody>
        </table>
    </div>
</div>

@endsection
